/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package intelligenttm.SourceFile;

/**
 *
 * @author 望舒凌霄
 */
public class SavePicControl {
    private int Width=600;
    private int Height=800;
    private double PPI=96;
    private double PPM=3.7795;
    private double QUALITY=1;
    private double PIXEL_UNIT_TO_MILLIMETER=0.264583;
    
    
    //构造函数
    public SavePicControl() {
    }

    public SavePicControl(int w,int h,double ppi,double ppm,double q,double p2mm) {
        Width=w;
        Height=h;
        PPI=ppi;
        PPM=ppm;
        QUALITY=q;
        PIXEL_UNIT_TO_MILLIMETER=p2mm;
    }
    
    
    //Type==PPI
    public void Caculate(String Type){
        if(Type=="PPI"){
            PPM=PPI*(3.7795/96);
            PIXEL_UNIT_TO_MILLIMETER=1/PPM;
        }
        else if(Type=="PPM"){
            PPI=PPM*(96/3.7795);
            PIXEL_UNIT_TO_MILLIMETER=1/PPM;
        }
    }

    public int getWidth() {
        return Width;
    }

    public void setWidth(int Width) {
        this.Width = Width;
    }

    public int getHeight() {
        return Height;
    }

    public void setHeight(int Height) {
        this.Height = Height;
    }

    public double getPPI() {
        return PPI;
    }

    public void setPPI(double PPI) {
        this.PPI = PPI;
    }

    public double getPPM() {
        return PPM;
    }

    public void setPPM(double PPM) {
        this.PPM = PPM;
    }

    public double getQUALITY() {
        return QUALITY;
    }

    public void setQUALITY(double QUALITY) {
        this.QUALITY = QUALITY;
    }

    public double getPIXEL_UNIT_TO_MILLIMETER() {
        return PIXEL_UNIT_TO_MILLIMETER;
    }

    public void setPIXEL_UNIT_TO_MILLIMETER(double PIXEL_UNIT_TO_MILLIMETER) {
        this.PIXEL_UNIT_TO_MILLIMETER = PIXEL_UNIT_TO_MILLIMETER;
    }
}
